<template>
	<view class="container">
		<!--证书-->
		<view v-if="navIndex == 0">
			<view class="card">
				<view class="title"><view class="name">基本信息</view></view>
				<view class="item">持证人：{{ form.cert_man || '' }}</view>
				<view class="item">证书编号：{{ form.num || '' }}</view>
				<view class="item">准操项目：{{ form.job_project || '' }}</view>
				<view class="item">作业类别：{{ form.cert_man || '' }}</view>
				<view class="item">领证日期：{{ form.getcert_time || '' }}</view>
				<view class="item">有效期：{{ form.last_day || '' }}</view>
				<view class="item">复审期限：{{ form.fushen_lasttime || '' }}</view>
			</view>
		</view>
		<!--设备-->
		<view v-if="navIndex == 1">
			<view class="card">
				<view class="title"><view class="name">基本信息</view></view>
				<view class="item">设备名称：{{ form.name || '' }}</view>
				<view class="item">规格型号：{{ form.guige || '' }}</view>
				<view class="item">投用时间：{{ form.use_time || '' }}</view>
				<view class="item">厂内编号：{{ form.num_inner || '' }}</view>
				<view class="item">责任人：{{ form.response_man_name || '' }}</view>
			</view>
			<view class="card">
				<view class="title"><view class="name">检测信息</view></view>
				<view class="item">检测周期：{{ form.cycle || '' }}</view>
				<view class="item">上次检测时间：{{ form.last_check_time || '' }}</view>
				<view class="item">检测单位：{{ form.check_logs[0].danwei || '' }}</view>
				<view class="item">检测结论：{{ form.check_logs[0].resout || '' }}</view>
				<view class="item">下次检测时间：{{ form.next_check_time || '' }}</view>
			</view>
		</view>
		<!--人员-->
		<view v-if="navIndex == 2">
			<view class="card">
				<view class="title"><view class="name">基本信息</view></view>
				<view class="item">姓名：{{ form.name || '' }}</view>
				<view class="item">职务：{{ form.roleName || '' }}</view>
				<view class="item">有效时间：{{ form.start_time || '' }} 至 {{ form.over_time || '' }}</view>
				<view class="item">备注：{{ form.remarks || '' }}</view>
				<view class="item">复训时间：{{ form.cert_man || '' }}</view>
				<view v-if="form.is_fuxun" class="item">复训状态：<text style="color: #33CC00;">已复训</text></view>
				<view v-else class="item">复训状态：<text style="color: #F98202;">未复训</text></view>
			</view>
		</view>
	</view>
</template>

<script>
export default{
	data(){
		return {
			navs: ['特种证书','特种设备','安全管理人员'],
			navIndex: 0,
			form: {}
		}
	},
	onLoad(option){
		// 处理标题
		this.navIndex = option.type || 0;
		uni.setNavigationBarTitle({
			title: this.navs[this.navIndex]
		});
		
		// 处理内容数据
		this.form = uni.getStorageSync('infoShareSpecialDetail') || {};
	},
	onBackPress(){
		uni.removeStorageSync('infoShareSpecialDetail');
	}
}
</script>

<style scoped>
.container{
	height: 100vh;
	overflow-y: auto;
}
/*卡片*/
.card{
	margin: 20upx 20upx 0;
	border-radius: 16upx;
	padding: 14upx 20upx 8upx;
	border: 2upx solid #F6F6F6;
	box-shadow: 0 0 4upx #eee;
	background-color: #fff;
	position: relative;
}
.card .title{
	margin-bottom: 6upx;
}
.card .title view{
	height: 42upx;
	font-size: 30upx;
}
.card .title view.name{
	text-indent: 20upx;
	font-weight: bold;
	position: relative;
}
.card .title view.name::before{
	content: '';
	width: 10upx;
	height: 26upx;
	background: #5F96F2;
	border-radius: 4upx;
	position: absolute;
	top: 14upx;
	left: 0;
}
.card .item{
	font-size: 30upx;
}
</style>
